import { regs } from '@/utils/validate'

export const basicFields = (info) => {
  return [
    {
      key: 'realName',
      label: '姓名',
      initialValue: info.realName,
      rules: [{ required: true, message: '请输入教保师姓名' }]
    },
    {
      key: 'gender',
      label: '性别',
      type: 'select',
      initialValue: info.gender,
      fieldProps: {
        dictKey: 'sex',
        props: { value: 'value', label: 'label' }
      }
    },
    {
      key: 'mobile',
      label: '手机号',
      initialValue: info.mobile,
      rules: [{ required: true, message: '请输入教保师姓名' }, { pattern: regs.phone, message: '请输入正确手机号码' }]
    },
    {
      key: 'email',
      label: '邮箱',
      initialValue: info.email,
      rules: [{ pattern: regs.email, message: '请输入正确手机号码' }]
    },
    {
      key: 'entryDate',
      label: '入职日期',
      initialValue: info.entryDate,
      rules: [{ required: true, message: '请输入教保师姓名' }],
      type: 'date'
    },
    {
      key: 'positiveDate',
      label: '转正日期',
      initialValue: info.positiveDate,
      type: 'date'
    },
    {
      key: 'salary',
      label: '薪资',
      initialValue: info.salary,
      type: 'number'
    },
    {
      key: 'linkman',
      label: '联系人',
      type: 'slot'
    },
    {
      key: 'remark',
      label: '备注',
      initialValue: info.remark,
      type: 'textarea',
      layoutCol: { sm: 24, md: 24, lg: 24 }
    }
  ]
}

export const courseStudyColumn = [
  {
    prop: 'slot',
    label: '序号'
  },
  {
    prop: 'realName',
    label: '课程名称'
  },
  {
    prop: 'gender',
    label: '课程类型'
  },
  {
    prop: 'positionName',
    label: '学习时长'
  }
]

export const checkStatusList = [
  {
    value: '1',
    label: '已入园'
  },
  {
    value: '2',
    label: '已离园'
  },
  {
    value: '3',
    label: '拒绝入园'
  },
  {
    value: '4',
    label: '请假'
  },
  {
    value: '0',
    label: '缺席'
  }
]
